home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0093_LZH Extract Front End.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  3.6 KB  |  133 lines

  1. {
  2. INSTALLER
  3.  
  4. Param 1 : Path to where .LZH files reside
  5.       2 : Path to install to.
  6.       3 (optional) : Where LHA.EXE program resides,
  7.         default is C:\DOS
  8.  
  9. All of the LZH files in the directory shall be unpacked to
  10. the install directory.
  11. }
  12.  
  13. Uses CRT, DOS;
  14.  
  15. Var  DirInfo: SearchRec;
  16.      Archive_Loc : char;
  17.      LhaPath: pathstr;
  18.      LZH_Count: byte;
  19.      LZH_Name: string[8];
  20.  
  21.  
  22. {$M 4000,0,0}
  23.  
  24. Begin
  25.      If ParamCount in[2,3] Then
  26.      Begin
  27.         TextBackground(Blue);
  28.         TextColor(White);
  29.         ClrScr;
  30.  
  31.         TextBackground(LightGray);
  32.         TextColor(Black);
  33.  
  34.         ClrEol;
  35.         Writeln('LHArc INSTALLER (C) 1994 Scott Tunstall. All rights reserved.');
  36.         Writeln;
  37.  
  38.         TextBackground(Blue);
  39.         TextColor(LightGray);
  40.  
  41.         Writeln('Installing .LZH files FROM : ', ParamStr(1));
  42.         Writeln('                      TO   : ', ParamStr(2));
  43.  
  44.  
  45.         { O.K. That's the end of the niceness. }
  46.  
  47.  
  48.         If ParamCount=3 Then
  49.            Begin
  50.            LhaPath:=Paramstr(3);
  51.            If LhaPath[Length(LHAPath)]<>'\' Then
  52.               LhaPath:=LhaPath+'\';
  53.            End
  54.         Else
  55.             LhaPath:='C:';
  56.  
  57.  
  58.         Writeln;
  59.         Writeln;
  60.         Writeln('Looking for LHA.EXE in directory ',LHAPath,'..');
  61.  
  62.         If Fsearch('LHA.EXE',LHAPath)<>'' Then
  63.            Begin
  64.            LZH_Count:=0;
  65.            LZH_Name:=ParamStr(1)+'*.LZH';
  66.  
  67.            FindFirst(LZH_Name,AnyFile,DirInfo);
  68.  
  69.            If DosError <>0 Then
  70.               Writeln('Could not find any .LZH files ! Check your SOURCE PATH !')
  71.            Else
  72.            Begin
  73.                While (DosError = 0) do
  74.                Begin
  75.                   SwapVectors;
  76.                   Exec(LhaPath+'LHA.EXE','e '+ParamStr(1)+DirInfo.Name+' '+ParamStr(2));
  77.                   SwapVectors;
  78.  
  79.                   If DosError = 0  Then
  80.                      Begin
  81.                      Inc(LZH_Count);
  82.                      FindNext(DirInfo);
  83.                      End
  84.                   Else
  85.                       Begin
  86.                       Writeln;
  87.                       Writeln('A DOS error has occurred!. Program execution halted.');
  88.                   End;
  89.  
  90.                End;
  91.                Writeln;
  92.                Writeln;
  93.                Writeln(LZH_Count,' archive(s) transferred. All done!');
  94.            End;
  95.            End
  96.         Else
  97.             Begin
  98.             Writeln;
  99.             Writeln('Could not find LHA.EXE, the Main Archival Program.');
  100.             Writeln('Please check that it is in the appropriate directory!');
  101.             Writeln;
  102.         End;
  103.  
  104.      End
  105. Else
  106.     Begin
  107.     Writeln;
  108.     Writeln('LZH UNPACKER  (C) 1994 SCOTT "TOODY" TUNSTALL');
  109.     Writeln;
  110.     Writeln;
  111.     Writeln('Usage :');
  112.     Writeln;
  113.     Writeln('DECRUNCH <src file path> <dest path> [path to LHA program]');
  114.     Writeln;
  115.     Writeln('i.e. To decrunch all .LZH files in directory A:\WORK');
  116.     Writeln('to directory C:\GAMES you would type :');
  117.     Writeln;
  118.     Writeln('DECRUNCH A:\ C:\GAMES\   <- REMEMBER THE BACKSLASH "\" !');
  119.     Writeln;
  120.     Writeln;
  121.     Writeln('Finally, the last parameter is the PATH to where the LHA');
  122.     Writeln('program resides on disk. It should ALWAYS be on a fixed');
  123.     Writeln('disk (hard disk) system where it can be continually accessed.');
  124.     Writeln('The DEFAULT PATH is C:, which means this param is optional !');
  125.     Writeln;
  126.     Writeln;
  127.     Writeln('Finally, hello to all the guys at Lauder College who love to');
  128.     Writeln('go out and get STEAMIN!.');
  129.     Writeln;
  130.     End;
  131. End.
  132.  
  133.